home *** CD-ROM | disk | FTP | other *** search
- /*********************************************************************\
- LaunchURL.c
- © Dan Crevier, 1998
-
- Code for a OneClick extension to launch a URL
-
- LaunchURL theURL
-
- \*********************************************************************/
-
- #include "OC Extension.h"
-
- #include "ICTypes.h"
- #include "ICAPI.h"
-
- pascal void main(ExternalParameterRec *pXRef)
- {
- valueRec inURL;
- ICInstance inst;
-
- if (GetStringValue(pXRef, &inURL))
- {
- if (ICStart(&inst, '????') == noErr)
- {
- if (ICFindConfigFile(inst, 0, nil) == noErr)
- {
- long selStart = 0, selEnd = inURL.len;
- ICLaunchURL(inst, "\p", inURL.p, inURL.len, &selStart, &selEnd);
- }
- ICStop(inst);
- }
-
- DisposeValue(pXRef, &inURL);
- }
-
- }
-
-